Repository navigation
8.0: API Group + v1.24 - #850
Merged
Merged
Conversation
Contributor
|
/lgtm Thanks! |
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brendandburns, tg123 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
kimpenhaus
added a commit
to dotnet/dotnet-operator-sdk
that referenced
this pull request
Nov 28, 2026
## Summary
`KubernetesClient` sends every request through the custom objects API
(`CustomObjects.*`, also via `GenericClient`),
including core types, for which the group is empty. The generated
Kubernetes client rewrites the resulting
`/apis//v1/...` path to `/api/v1/...` (`url.Replace("apis//", "api/")`
in `Operations.cs.template`, since
kubernetes-client/csharp#850, KubernetesClient 8.0). Upstream's own
`GenericClient` relies on the same mechanism for
core types, so the paths on the wire are correct; building them
ourselves would mean replacing every
`CustomObjects` call with own request code.
This PR pins the method and path that are sent for core types with the
existing `StubApiServer`, so that a change of
that behaviour is noticed on the next dependency update:
| Method | Request |
| --- | --- |
| `GetAsync` | `GET /api/v1/namespaces/default/configmaps/my-config`,
`GET /api/v1/namespaces/my-namespace` |
| `ListAsync` | `GET /api/v1/namespaces/default/configmaps`, `GET
/api/v1/configmaps` |
| `WatchAsync` | `GET /api/v1/namespaces/default/configmaps?watch=true`,
`GET /api/v1/configmaps?watch=true` |
| `CreateAsync` | `POST /api/v1/namespaces/default/configmaps` |
| `UpdateAsync` | `PUT /api/v1/namespaces/default/configmaps/my-config`
|
| `PatchAsync` | `PATCH /api/v1/namespaces/default/configmaps/my-config`
|
| `DeleteAsync` | `DELETE
/api/v1/namespaces/default/configmaps/my-config` |
| `UpdateStatusAsync` | `PATCH
/api/v1/namespaces/default/pods/my-pod/status`, `PATCH
/api/v1/namespaces/my-namespace/status` |
`UpdateStatusAsync` for core types had no coverage at all; the other
methods were only covered indirectly by the
integration tests with `V1ConfigMap`.
No production code changes.
## Checks
- `/simplify`: the stub answers with the entity in the status tests; a
shared base class for the stubbed client
tests (now three copies) was left out, as it would touch files outside
this PR. Added Watch, all-namespaces List,
cluster-scoped Get and Update after the altitude review.
- `/code-review` (medium): no bugs; added the HTTP method to every
assertion, parsed the watch query and added the
all-namespaces watch. Not added: cluster-scoped
Create/Update/Patch/Delete for `V1Namespace` and the patch body
(covered in `KubernetesClient.Patch.Test.cs`).
- `/security-review`: test-only change, nothing to review.
- `dotnet build -c Release` without warnings, `dotnet format
--verify-no-changes`, unit tests of
`KubeOps.KubernetesClient.Test` (156) pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
api group [breaking change to code]
why this change
before api group, apis with same operationid, for example
getAPIResources, were suffixed with a number which does not make any sense.this change is also aligning api style with other sdk, for example, java
new api exmaple
before
after
something should follow up
client.CoreV1creates a new object each time which can be optimized and cached